import React from 'react';
import { PermissionRoute } from '@choerodon/master';
import { Switch } from 'react-router-dom';

const ContinuousDeploymentList = React.lazy(() => import('./deployment-list'));
const ContinuousDeploymentDetail = React.lazy(() => import('./deployment-detail'));
const ContinuousDeploymentOpeation = React.lazy(() => import('./deployment-operation'));

const Index = ({ match }:any) => (
  <Switch>
    <PermissionRoute
      service={[]}
      path={`${match.url}/continuous-deployment`}
      component={ContinuousDeploymentList}
      exact
    />
    <PermissionRoute
      service={[]}
      path={`${match.url}/continuous-deployment/detail/:id`}
      component={ContinuousDeploymentDetail}
      exact
    />
    <PermissionRoute
      service={[]}
      path={`${match.url}/continuous-deployment/operation/:type`}
      component={ContinuousDeploymentOpeation}
      exact
    />
  </Switch>
);

export default Index;
